﻿<UserControl x:Class="Xpom_Xpum__Integrated_Development_Environment.View.Controls.TabControlView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:cv="clr-namespace:Xpom_Xpum__Integrated_Development_Environment.View.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <TabControl Name="tabControl1" ItemsSource="{Binding ta}" SelectedIndex="{Binding SelectedTabIndex}" SelectionChanged="tabControl1_SelectionChanged">
            <TabControl.Resources>

                <Style TargetType="TabItem">
                    <Setter Property="AllowDrop" Value="True"/>
                    <EventSetter Event="PreviewMouseMove" Handler="TabItem_PreviewMouseMove"/>
                    <EventSetter Event="Drop" Handler="TabItem_Drop"/>

                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <ContentControl Content="{Binding TextEditor}"/>
                                <!-- <cv:TextEditorView Text2="{Binding Code, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> -->
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </TabControl.Resources>
            <TabControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="0" Height="20">
                        <TextBlock VerticalAlignment="Center" Text="{Binding Header}" />
                        <Button Margin="5,0,0,0" Width="15" Height="15" Background="#FFFF5632" Content="X" Click="Button_Click" FontSize="11" Foreground="White" FontWeight="Bold" BorderThickness="0" BorderBrush="{x:Null}" />
                    </StackPanel>
                </DataTemplate>
            </TabControl.ItemTemplate>
        </TabControl>
    </Grid>
</UserControl>
